package com.ygxsk.carhome.ui.adapter;

import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.ygxsk.carhome.R;
import com.ygxsk.carhome.response.WorkPoolOneClickRepairHistoryBean;

import java.util.List;

/*
 * @Author:itchenqi175@163.com
 * @Time:2023/12/29  10:49
 * @Description: 返修的历史列表内容
 */
public class RepairComBackAdapter extends BaseQuickAdapter<WorkPoolOneClickRepairHistoryBean, BaseViewHolder> {

    public RepairComBackAdapter(int layoutResId, @Nullable List<WorkPoolOneClickRepairHistoryBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, WorkPoolOneClickRepairHistoryBean workPoolOneClickRepairHistoryBean) {

        if (workPoolOneClickRepairHistoryBean != null) {

            //工单池编号
            String repairNo = workPoolOneClickRepairHistoryBean.getRepairNo();
            //工单的维修状态
            String repairStatusInfo = workPoolOneClickRepairHistoryBean.getRepairStatusInfo();

            //工单编号的文本
            TextView textViewWorkComBackNumber = (TextView) helper.getView(R.id.textviewworkcombacknumber);
            //工单状态的文本
            TextView textViewStateInWorkPoolComBackItem = (TextView) helper.getView(R.id.textviewstateinworkpoolcombackitem);
            //添加底部的横线的帮助布局
            TextView textViewLineInComeBackAdapter = (TextView) helper.getView(R.id.textviewlineincomebackadapter);

            if (textViewWorkComBackNumber != null) {
                textViewWorkComBackNumber.setText(repairNo);
            }

            if (textViewStateInWorkPoolComBackItem != null) {
                textViewStateInWorkPoolComBackItem.setText(repairStatusInfo);
            }


            /*if (helper.getLayoutPosition() == (mData.size() - 1)) {
                textViewLineInComeBackAdapter.setVisibility(View.GONE);
            } else {
                textViewLineInComeBackAdapter.setVisibility(View.VISIBLE);
            }*/


        }

    }

}
